###readme.txt

This folder contains the all Tables and Figures in original analysis included
in Chapter 4 of:
    Enos, Ryan D. 2017. The Space Between Us:
        Social Geography and Politics

Updated: November 28, 2017

***To replicate these files*** run "Chapter4Master.r" by typing
"source('Chapter4Master.r')" into the R terminal. This will use pre-processed
data to output tables and figures in the book and appendix. It does so by calling
the subordinate files: "TablesA14A15A16Figures4_3A1.r",
"TablesA17A18A19A20.r", "TableA21.r", and "TableA22.r"

**Prior to executing the scripts, the R terminal should be pointed to the
directory in which the replication files are located, which can be accomplished
by typing "setwd('..')" where ".." is the local file structure where the replication
files are located.

These files require the R programming language, which can be downloaded here: http://www.r-project.org/

You execute replication_master.r, you may need to install the packages used,
this can be accomplished by typing the following in the R terminal:
install.packages('apsrtable'); install.packages('ggplot2');
install.packages('xtable'); install.packages('RColorBrewer');
install.packages('plyr'); install.packages('Zelig')

Questions? Please contact Ryan Enos (renos@gov.harvard.edu).

************************************************************** ***

There is one .csv files associated with each of these scripts. Descriptions the csv
and variables included are below:

***TablesA14A15A16Figures4_3A1_data.csv***

creates output for Tables A14-A16 and Figure A1 in the Appendix and Figure 4.3 in the
book.  The data contains one row per survey response, so a subject can be represented by more than one row.

Variables:

"prop.chance.tracts": the probability of a subject choosing the correct Census Tract by chance.

"polyorigin": the label the subject gave to a Census Tract. Can be one or more groups: "AB" Asian and Black, "ABH" Asian, Black, and Hispanic,
 "ABHW" Asian, Black, Hispanic, and white, "ABW" Asian, Black, and white, "AH" Asian and Hispanic,
 "AHW" Asian, Hispanic, and white , "Asian" Asian,  "AW" Asian and white, BH" Black and Hispanic,
 "BHW" Black, Hispanic, and white, "Black" Black, "BW" Black and white, "Hispanic" Hispanic,
 "HW" Hispanic and white, "White" white.

"asian.correct.tract": is the Tract the Tract in the Zip code with the most Asian residents?

"black.correct.tract": is the Tract the Tract in the Zip code with the most Black residents?

"hispanic.correct.tract": is the Tract the Tract in the Zip code with the most Hispanic residents?

"white.correct.tract": : is the Tract the Tract in the Zip code with the most white residents?

"prop.chance.bg": the probability of a subject choosing the correct Census Block Group by chance.

"asian.correct.bg": is the Block Group the Block Group in the Zip code with the most Asian residents?

"black.correct.bg": is the Block Group the Block Group in the Zip code with the most Black residents?

"hispanic.correct.bg": is the Block Group the Block Group in the Zip code with the most Hispanic residents?

"white.correct.bg": is the Block Group the Block Group in the Zip code with the most white residents?

"prop.chance.adj": the probability of a subject choosing the correct Census Block Group or adjacent Census Block Group by chance.

"asian.correct.adj": is the Block Group the Block Group or adjacent to the Block Group with in the Zip code with the most Asian residents?

"black.correct.adj": is the Block Group the Block Group or adjacent to the Block Group with in the Zip code with the most Black residents?

"hispanic.correct.adj": is the Block Group the Block Group or adjacent to the Block Group with in the Zip code with the most Hispanic residents?

"white.correct.adj": is the Block Group the Block Group or adjacent to the Block Group with in the Zip code with the most white residents?

"dissimilarity.asian": Asian/non-Asian dissimilarity measured at the CBSA level in 2010

dissimilarity.black": Black/non-Black dissimilarity measured at the CBSA level in 2010

"dissimilarity.hispanic": Hispanic/non-Hispanic dissimilarity measured at the CBSA level in 2010

"dissimilarity.white": white/non-white dissimilarity measured at the CBSA level in 2010

"percent.asian": proportion Asian of the total Asian and white population in the CBSA in 2010

"percent.black": proportion Black of the total Black and white population in the CBSA in 2010

"percent.hispanic": proportion Hispanic of the total Hispanic and Anglo population in the CBSA in 2010

"percent.white": proportion white of the total population in the CBSA in 2010

"asian.dev.abs": absolute deviation of subject's guess at percent Asian in the Zip code from true percent Asian

"black.dev.abs": absolute deviation of subject's guess at percent Asian in the Zip code from true percent Black

"hispanic.dev.abs": absolute deviation of subject's guess at percent Asian in the Zip code from true percent Hispanic

"white.dev.abs": absolute deviation of subject's guess at percent Asian in the Zip code from true percent white

"metroid": numeric code for CBSA

"STATE_FIPS": state FIPS code

"south": Is state in South according to Census region designations


***TablesA17A18A19A20_data.csv***

creates output for Tables A17-A20 and results reported in text on page 89 of the book.

Variables:

"pse": point of subjective equality

"dissimilarity": Black/white dissimilarity measured at CBSA level in 2010

"percent.black": proportion Black of the total Black and white population in the
CBSA in 2010

"income.recode": individual income

college.educated": bachelor's degree or higher

"contact": how much contact does the subject have with Blacks, 1-5, with 5
being most, taken from Islam and Hewstone (1993)

"metroid": numeric code for CBSA

"south" Is state in South according to Census region designations

"study": 1 if the sample is from DLABSS, 2 if the sample is from Qualtrics


***TableA21_data.csv***

creates output for Tables A21.

Variables:

"segsTsum": mean response across all tall lines when lines are segregated, in
centimeters

"intsTsum": mean response across all tall lines when lines are integrated, in
centimeters

"segsSsum": mean response across all short lines when lines are segregated, in
centimeters

"intsSsum": mean response across all short lines when lines are integrated, in
centimeters

"segsDiff": SegsTsum minus SegsSsum

"intsDiff": intsTsum minus intsSsum

"diff": segsDiff minus IntsDiff

"age": subject age in years

"gender": 1 = man; 2 = woman

"test": round of test 1 - 5


***TableA22_data.csv***

creates output for Tables A22.

Variables:

"int.darks.sum": mean response across all dark squares when lines are
integrated, 0-100 scale with 100 being darkest

"seg.darks.sum": mean response across all dark squares when lines are
segregated, 0-100 scale with 100 being darkest

"int.lights.sum": mean response across all light squares when lines are
integrated, 0-100 scale with 100 being darkest

"seg.lights.sum": mean response across all light squares when lines are
segregated, 0-100 scale with 100 being darkest

"segsDiff": seg.darks.sum minus seg.lights.sum

"intsDiff": int.darks.sum minus int.lights.sum

"diff": segsDiff minus IntsDiff

"age": subject age in years

"gender": 1 = man; 2 = woman

"test": round of test 1 - 5
